package com.tangyuan.common.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PhoneNumberUtil {

    public static boolean isValidPhoneNumber(String phoneNumber) {
        if(StringUtils.isEmpty(phoneNumber)){
            return false;
        }
        // 手机号正则表达式
        String regex = "^((13[0-9])|(14[5,7,9])|(15[^4])|(16[6])|(17[0-8])|(18[0-9])|(19[1,8,9]))\\d{8}$";
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(phoneNumber);
        return matcher.matches();
    }
}
